package com.ydd.mapper;




import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.github.pagehelper.Page;
import com.ydd.dto.AddUserDTO;
import com.ydd.dto.PageDTO;
import com.ydd.dto.UpdateUserDTO;
import com.ydd.entity.YddUser;
import com.ydd.vo.NewUser;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;



import java.util.List;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author itcast
 * @since 2023-05-15
 */
public interface YddUserMapper extends BaseMapper<YddUser> {
    @Select("select * from ydd_user where mobile =#{mobile}")
    YddUser getUserPassword(String mobile);

    List<NewUser> getNewUser();

    @Select("select * from ydd_user where id=#{id}")
    YddUser searchById(String id);


    Page<YddUser> searchUser(PageDTO pageDTO);

    /**
     * 添加数据
     * @param addUserDTO
     */
    void addUser(AddUserDTO addUserDTO);

    /**
     * 根据id删除数据
     * @param id
     */
    @Delete("delete from ydd_user where id=#{id}")
    void deleteUserById(String id);


    void updateUser(UpdateUserDTO updateUserDTO);
}
